

var Ajax = {

  _RET_NULL   : " ",
  _CONN_ERROR : "****",
  
  modelType : function (thisObj){
  
    var xmlHttp = new XMLHttpRequest();
    
    var url     = "/ecs/tocmenu_11/controllers/getModelType.php" +"?sid="+Math.random();
    var params  = " ";
    
    xmlHttp.open("POST", url, false);
    
    xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xmlHttp.setRequestHeader("Content-length", params.length);
    xmlHttp.setRequestHeader("Connection", "close");
    
    xmlHttp.onreadystatechange = function() {
      
    }
    
    xmlHttp.send(params);
    
    switch(xmlHttp.responseText){
      
      case this._CONN_ERROR:
      
        alert("Db Connection failed");
        break;
        
      case this._RET_NULL:
      
        alert("System has given up");
        break;
      
      default:
        thisObj.innerHTML = xmlHttp.responseText;
    }
  },

  sayHello : function(){
  
    alert("Ajax Linked");
  }
} 